home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 3 #6 / Commodore_Disk_User_Vol.3_6_1990_-.d64 / random div quiz (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  2KB  |  61 lines

  1. 1 rem 3d demo, (c)1989 m.h.westerweel
  2. 2 poke53280,14:poke53281,6:poke646,14
  3. 3 rem read 1st file from disk
  4. 4 rem =======================
  5. 5 dimd3$(43):open8,8,8,"0:3d-text file,s,r"
  6. 10 ford3=1to36:input#8,x$:input#8,y$:d3$(d3)=x$+y$:next
  7. 15 ford3=37to42:input#8,d3$(d3):next:close8
  8. 20 d3$(43)=chr$(13)+""
  9. 22 :
  10. 23 rem read 2nd file from disk
  11. 24 rem =======================
  12. 25 dimdd$(43):open8,8,8,"0:3d-text file 2,s,r"
  13. 30 fordd=1to36:input#8,x$:input#8,y$:dd$(dd)=x$+y$:next
  14. 35 fordd=37to42:input#8,dd$(dd):next:close8:dd$(43)=d3$(43)
  15. 37 :
  16. 38 rem initialize strings & rnd
  17. 39 rem ========================
  18. 40 up$="[145][145][145][145][145]":z$="[147][146]":tt=rnd(-ti)
  19. 47 :
  20. 48 rem read wrong, right & huh?!? data
  21. 49 rem ===============================
  22. 50 dima(16):fora=1to16:reada(a):next
  23. 52 :
  24. 53 rem read wow!!! (center screen) data
  25. 54 rem ================================
  26. 55 dimb(14):forb=1to14:readb(b):next
  27. 57 :
  28. 58 rem randomize division problems
  29. 59 rem ===========================
  30. 60 x=int(15*rnd(1))+1:y=int(15*rnd(1))+1:xy=x*y
  31. 70 printz$;xy;"/";y;"= ";
  32. 77 :
  33. 78 rem process user's response
  34. 79 rem =======================
  35. 80 inputi$:print:printchr$(29);:i=val(i$):ifi=xthen110
  36. 90 ifi<1ori>15then120
  37. 97 :
  38. 98 :rem print feedback to screen
  39. 99 :rem ========================
  40. 100 fora=1to5:printd3$(a(a))up$;:next:wr=wr+1:goto130
  41. 110 fora=6to10:printd3$(a(a))up$;:next:ri=ri+1:goto130
  42. 120 fora=11to16:printd3$(a(a))up$;:next:h=1
  43. 130 i$="":forw=1to1000:nextw:ifh=1thenh=0:goto70
  44. 140 ifwr+ri<10then60
  45. 150 printz$spc(10);ri;"out of 10 right":ifri<8then170
  46. 152 :
  47. 153 rem print wow!!! for 8+/10 right
  48. 154 rem ============================
  49. 155 forzz=1to10
  50. 160 print"";:forb=1to14:printd3$(b(b))up$;:next
  51. 165 print"";:forb=1to14:printdd$(b(b))up$;:next:next
  52. 167 :
  53. 168 rem reset for next 10 problems
  54. 169 rem ==========================
  55. 170 ri=0:wr=0:forw=1to2000:nextw:goto60
  56. 997 :
  57. 998 :rem data for printing 3d text
  58. 999 :rem =========================
  59. 1000 data 23,18,15,14,7,18,9,7,8,20,8,21,8,41,40,41
  60. 1005 data 43,42,42,42,42,42,42,42,23,15,23,40,40,40
  61.